# Maintainer: Orhun Parmaksız <orhun@archlinux.org>

pkgname=ali
pkgver=0.7.5
pkgrel=2
pkgdesc="Generate HTTP load and plot the results in real-time"
arch=('loong64' 'x86_64')
url="https://github.com/nakabonne/ali"
license=('MIT')
depends=('glibc')
makedepends=('go')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha512sums=('6ae745556bec663abcb2a8d6c5e090fdd5e6b5a8bb889f85c528f749de79eb0e33d794265a801983f8de81629e19a1a38fe147e5095108310b1a353766866ff3')

build() {
  cd "$pkgname-$pkgver"
  export CGO_CPPFLAGS="${CPPFLAGS}"
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CXXFLAGS="${CXXFLAGS}"
  export CGO_LDFLAGS="${LDFLAGS}"
  export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
  go build -o "$pkgname" .
}

package() {
  cd "$pkgname-$pkgver"
  install -Dm 755 "$pkgname" -t "$pkgdir/usr/bin"
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
  install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}

# vim: ts=2 sw=2 et:
